import torch

from problems.LMF import LMF


class LMF6(LMF):
    def __init__(self, var_dim: int, obj_dim: int, max_fun_eval, kwargs: dict):
        super().__init__(var_dim, obj_dim, max_fun_eval, kwargs)
        low_limit = torch.cat((-1 * torch.ones(1, self.K), torch.zeros(1, self.L)), dim=1)
        high_limit = torch.cat((torch.ones(1, self.K), 2 * torch.ones(1, self.L)), dim=1)
        self.set_boundary(low_limit, high_limit)

    def eval_value(self, pop_dec):
        return super().eval_obj(pop_dec, self.get_H2, super().func_type1, super().sphere, super().schwefel2,
                                super().ackley, super().sphere, super().schwefel221, super().rastrigin)

    def get_optimal_solutions(self, size):
        return super().get_optimal_solutions2(size)
